package com.wmx.thread.join;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

/**********************************
 * @author wmx
 * @date 2019/9/26 16:25
 * @description:
 * @version 1.0
 ************************************/
@Slf4j
public class JoinDemo {
    public static void main(String[] args) throws InterruptedException {
        Thread threadOne = new Thread(() -> {
            for (int i = 0; i < 5; i++) {

                log.info("线程" + Thread.currentThread().getName() + ":" + i);
            }
        });
        threadOne.setDaemon(true);
        log.info("线程=====" + Thread.currentThread().getName());
        threadOne.start();
        System.out.println("当前线程" + Thread.currentThread().getName());
        threadOne.join();

    }
}
